<template>
  <div>
    <form>
      <span>用户名</span>
      <input type="text" name="text" v-model="form.text" /><br />
      <span>密码</span>
      <input type="text" name="password" v-model="form.password" />
    </form>
  </div>
</template>
 
<script>
export default {
  props: {},
  data() {
    return {
      form: {
        text: "",
        password: "",
      },
    };
  },
  methods: {
    submit() {
      console.log(this.form.text, this.form.password);
      this.form = {
        text: "",
        password: "",
      }
    },
  },
};
</script>

<style scoped>
</style>